# 复数（18 2126）
class Complex(object):
	'''
	创建一个静态属性用来记录版本号
	'''
	version = 1.0
	
	'''
	初始化函数
	'''
	def __init__(self, rel=15, imag=15j):
		self.realPart = rel
		self.imagPart = imag
	
	# 创建复数
	def createComplex(self):
		return self.realPart + self.imagPart
	
	# 获取输入数字部分的虚部
	def getImag(self):
		imag = str(self.imagPart)
		imag = imag[:-1]
		return float(imag)

# 测试函数
def test():
	print('run test...')
	com = Complex()
	
	cplex = com.createComplex()
	if cplex.imag == com.getImag():
		print('p1=', com.getImag())
	else:
		print('pass 1.')
		pass
	
	if (cplex.real == com.realPart):
		print('p2=', com.realPart)
	else:
		print('pass 2.')
		pass
	
	print('the religion complex is :', cplex)
	print('共轭复数：', cplex.conjugate())

if __name__ == '__main__':
	test()